Export tab delimited from mysql to postgres.

Export tab delimited from mysql to postgres.

am 11.10.2004 00:59:40 von Theo.Galanakis

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C4AF1C.D2EB7D50
Content-Type: text/plain


Has anyone been able to export and import a tab delimited file from mysql to
postgres successfully?
This is my dilemma which I have posted on mysql sites with no response,
however postgres users may have come across the same issue:
Trying to export a tab delimited file with the following command, however it
does not appear to strip out the CR/LF within a varchar column.

select * into outfile '/tmp/users.txt' FIELDS ESCAPED BY '\\' LINES
TERMINATED BY '\r\n' from users;

However when I use the below function to export as an insert statement, it
escapes all the CR/LF within each column.

mysqldump --database mydatabase --password --user myusername --verbose
--complete-insert --tables users > myfile.sql

Does anyone have any insigt into why the above select does not escape CR/LF
within varchar columns?

I really want to get the export as tab delimited working to import into
postgres,which is much faster than insert statements.

Theo



____________________________________________________________ __________
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright. If you
have received this email in error, please advise the sender and delete
it. If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone. You must not copy or
communicate to others content that is confidential or subject to
copyright, unless you have the consent of the content owner.
------_=_NextPart_001_01C4AF1C.D2EB7D50
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable






Export tab delimited from mysql to postgres.



Has anyone been able to export and import=
a tab delimited file from mysql to postgres successfully?


This is my dilemma which I have posted o=
n mysql sites with no response, however postgres users may have come across=
the same issue:



Trying to export a tab delimited file wit=
h the following command, however it does not appear to strip out the CR/LF =
within a varchar column.



select * into outfile '/tmp/users.txt' FIELDS ESCAPED BY '\\' LINES TERMINA=
TED BY '\r\n' from users;



However when I use the below function to export as an insert statement, it =
escapes all the CR/LF within each column.



mysqldump --database mydatabase --password --user myusername --verbose --co=
mplete-insert --tables users > myfile.sql



Does anyone have any insigt into why the above select does not escape CR/LF=
within varchar columns?



I really want to get the export as tab delimited working to import into pos=
tgres,which is much faster than insert statements.



Theo





____________________=
__________________________________________________
This email, including=
attachments, is intended only for the addressee
and may be confidential=
, privileged and subject to copyright. If you
have received this email =
in error, please advise the sender and delete
it. If you are not the in=
tended recipient of this email, you must not
use, copy or disclose its c=
ontent to anyone. You must not copy or
communicate to others content t=
hat is confidential or subject to
copyright, unless you have the consen=
t of the content owner.
=

------_=_NextPart_001_01C4AF1C.D2EB7D50--

Re: Export tab delimited from mysql to postgres.

am 11.10.2004 11:33:55 von hf0722x

In article <82E30406384FFB44AFD1012BAB230B5505F40D3A@shiva.au.lpint.net>,
Theo Galanakis writes:

> Has anyone been able to export and import a tab delimited file from mysql to
> postgres successfully?
> This is my dilemma which I have posted on mysql sites with no response,
> however postgres users may have come across the same issue:

> Trying to export a tab delimited file with the following command, however it
> does not appear to strip out the CR/LF within a varchar column.
> select * into outfile '/tmp/users.txt' FIELDS ESCAPED BY '\\' LINES TERMINATED
> BY '\r\n' from users;

It's a MySQL bug/misfeature that it doesn't translate CRs into '\r'.
Nevertheless, you can import a MySQL tab delimited file into
PostgreSQL - just pipe it through a small sed script.


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Re: Export tab delimited from mysql to postgres.

am 12.10.2004 01:23:41 von Theo.Galanakis

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C4AFE9.5852AAF0
Content-Type: text/plain


Could you provide a example of how to do this?

I actually ended up exporting the data as Insert statements, which
strips out cf/lf within varchars. However it takes an eternity to import
200,000 records... 24 hours infact???? Is this normal?

Theo

-----Original Message-----
From: Harald Fuchs [mailto:hf0722x@protecting.net]
Sent: Monday, 11 October 2004 7:34 PM
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] Export tab delimited from mysql to postgres.


In article <82E30406384FFB44AFD1012BAB230B5505F40D3A@shiva.au.lpint.net>,
Theo Galanakis writes:

> Has anyone been able to export and import a tab delimited file from
> mysql to postgres successfully? This is my dilemma which I have posted
> on mysql sites with no response, however postgres users may have come
> across the same issue:

> Trying to export a tab delimited file with the following command,
> however it does not appear to strip out the CR/LF within a varchar
> column. select * into outfile '/tmp/users.txt' FIELDS ESCAPED BY '\\'
> LINES TERMINATED BY '\r\n' from users;

It's a MySQL bug/misfeature that it doesn't translate CRs into '\r'.
Nevertheless, you can import a MySQL tab delimited file into PostgreSQL -
just pipe it through a small sed script.


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


____________________________________________________________ __________
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright. If you
have received this email in error, please advise the sender and delete
it. If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone. You must not copy or
communicate to others content that is confidential or subject to
copyright, unless you have the consent of the content owner.
------_=_NextPart_001_01C4AFE9.5852AAF0
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable






RE: [SQL] Export tab delimited from mysql to postgres.



        Could you prov=
ide a example of how to do this?



        I actually end=
ed up exporting the data as Insert statements, which strips out cf/lf withi=
n varchars. However it takes an eternity to import 200,000 records... 24 ho=
urs infact???? Is this normal?



Theo



-----Original Message-----

From: Harald Fuchs [ ..net">mailto:hf0722x@protecting.net]

Sent: Monday, 11 October 2004 7:34 PM

To: pgsql-sql@postgresql.org

Subject: Re: [SQL] Export tab delimited from mysql to po=
stgres.





In article <82E30406384FFB44AFD1012BAB230B5505F40D3A@s=
hiva.au.lpint.net>,


Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>=
; writes:



> Has anyone been able to export and import a tab deli=
mited file from


> mysql to postgres successfully? This is my dilemma =
which I have posted


> on mysql sites with no response, however postgres u=
sers may have come


> across the same issue:



> Trying to export a tab delimited file with the follo=
wing command,


> however it does not appear to strip out the CR/LF w=
ithin a varchar


> column. select * into outfile '/tmp/users.txt' FIEL=
DS ESCAPED BY '\\'


> LINES TERMINATED BY '\r\n' from users;



It's a MySQL bug/misfeature that it doesn't translate CRs=
into '\r'. Nevertheless, you can import a MySQL tab delimited file into Po=
stgreSQL - just pipe it through a small sed script.





---------------------------(end of broadcast)------------=
---------------


TIP 4: Don't 'kill -9' the postmaster





____________________=
__________________________________________________
This email, including=
attachments, is intended only for the addressee
and may be confidential=
, privileged and subject to copyright. If you
have received this email =
in error, please advise the sender and delete
it. If you are not the in=
tended recipient of this email, you must not
use, copy or disclose its c=
ontent to anyone. You must not copy or
communicate to others content t=
hat is confidential or subject to
copyright, unless you have the consen=
t of the content owner.
=

------_=_NextPart_001_01C4AFE9.5852AAF0--

Re: Export tab delimited from mysql to postgres.

am 12.10.2004 01:40:50 von Bruno

On Tue, Oct 12, 2004 at 09:23:41 +1000,
Theo Galanakis wrote:
>
> Could you provide a example of how to do this?
>
> I actually ended up exporting the data as Insert statements, which
> strips out cf/lf within varchars. However it takes an eternity to import
> 200,000 records... 24 hours infact???? Is this normal?

Are you doing the load in one transaction?

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Re: Export tab delimited from mysql to postgres.

am 12.10.2004 02:46:02 von Christopher Browne

Quoth Theo.Galanakis@lonelyplanet.com.au (Theo Galanakis):
>         Could you provide a example of how to do this?
>
>         I actually ended up exporting the data as Insert statements,
> which strips out cf/lf within varchars. However it takes an eternity
> to import 200,000 records... 24 hours infact???? Is this normal?

I expect that this results from each INSERT being a separate
transaction.

If you put a BEGIN at the start and a COMMIT at the end, you'd
doubtless see an ENORMOUS improvement.

That's not even the _big_ improvement, either. The _big_ improvement
would involve reformatting the data so that you could use the COPY
statement, which is _way_ faster than a bunch of INSERTs. Take a look
at the documentation to see the formatting that is needed:

http://techdocs.postgresql.org/techdocs/usingcopy.php
http://www.faqs.org/docs/ppbook/x5504.htm
http://www.postgresql.org/docs/7.4/static/sql-copy.html
--
output = ("cbbrowne" "@" "ntlug.org")
http://www3.sympatico.ca/cbbrowne/lsf.html
Question: How many surrealists does it take to change a light bulb?

Answer: Two, one to hold the giraffe, and the other to fill the bathtub
with brightly colored machine tools.

Re: Export tab delimited from mysql to postgres.

am 12.10.2004 07:33:46 von Theo.Galanakis

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C4B01D.0B865670
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Thanks for all your comments,

I have beent trying the insert within a transaction block, however
it does not seem to reduce the time it takes to process each records. Mind
you there are 80 column and the insert statement explicitly defines the
column to insert into.

I need any tip I can get help me transform the text file into a
format postgres copy will successfully read.=0D

Here is sample of the current format of a mysql tab delimited dump..

columnA columnB=0D
1 What a day!
2 What a week it has
been!
3 What the!

As you can see row 2 has a value that holds a CR value which ends up
wrapping around onto the third line. Postgres copy command does not like
this and mysql is unable to replace the value with another type of
delimiter, like a \r.

So I gather I have to some how manually replace the carriage return with
something postgres understand \r...=0D

columnA columnB=0D
1 What a day!
2 What a week it has \r been!
3 What the!

How do I do this without getting a text file that looks like this=0D
1 What a day! \r\n2 What a week it has \r been!\r\n3
What the!\r\n

Any help would be appreciated.

Theo

-----Original Message-----
From: Christopher Browne [mailto:cbbrowne@acm.org]=0D
Sent: Tuesday, 12 October 2004 10:46 AM
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] Export tab delimited from mysql to postgres.


Quoth Theo.Galanakis@lonelyplanet.com.au (Theo Galanakis):
>       =A0 Could you provide a example of how to do this?
>
>       =A0 I actually ended up exporting the data as Insert st=
atements,
> which strips out cf/lf within varchars. However it takes an eternity=0D
> to import 200,000 records... 24 hours infact???? Is this normal?

I expect that this results from each INSERT being a separate transaction.

If you put a BEGIN at the start and a COMMIT at the end, you'd doubtless see
an ENORMOUS improvement.

That's not even the _big_ improvement, either. The _big_ improvement would
involve reformatting the data so that you could use the COPY statement,
which is _way_ faster than a bunch of INSERTs. Take a look at the
documentation to see the formatting that is needed:

http://techdocs.postgresql.org/techdocs/usingcopy.php
http://www.faqs.org/docs/ppbook/x5504.htm
http://www.postgresql.org/docs/7.4/static/sql-copy.html
--=0D
output =3D ("cbbrowne" "@" "ntlug.org")
http://www3.sympatico.ca/cbbrowne/lsf.html
Question: How many surrealists does it take to change a light bulb?

Answer: Two, one to hold the giraffe, and the other to fill the bathtub
with brightly colored machine tools.

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


____________________________________________________________ __________
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright. If you
have received this email in error, please advise the sender and delete
it. If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone. You must not copy or=0D
communicate to others content that is confidential or subject to=0D
copyright, unless you have the consent of the content owner.=

------_=_NextPart_001_01C4B01D.0B865670
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable




1">

RE: [SQL] Export tab delimited from mysql to postgres.



Thanks for all your comments,



        I have beent t=
rying the insert within a transaction block, however it does not seem to re=
duce the time it takes to process each records. Mind you there are 80 colum=
n and the insert statement explicitly defines the column to insert into. ONT>



        I need any tip=
I can get help me transform the text file into a format postgres copy will=
successfully read.



Here is sample of the current format of a mysql tab delim=
ited dump..



columnA columnB

1          =
     What a day!


2          =
     What a week it has


been!

3          =
     What the!



As you can see row 2 has a value that holds a CR value wh=
ich ends up wrapping around onto the third line. Postgres copy command does=
not like this and mysql is unable to replace the value with another type o=
f delimiter, like a \r.



So I gather I have to some how manually replace the carri=
age return with something postgres understand \r...



columnA columnB

1          =
     What a day!


2          =
     What a week it has \r been!


3          =
     What the!



How do I do this without getting a text file that looks l=
ike this


1       What a day! \r\n2&=
nbsp;            &nb=
sp; What a week it has \r been!\r\n3      &nb=
sp;         What the!\r\n



Any help would be appreciated.



Theo



-----Original Message-----

From: Christopher Browne [ ..org">mailto:cbbrowne@acm.org]

Sent: Tuesday, 12 October 2004 10:46 AM

To: pgsql-sql@postgresql.org

Subject: Re: [SQL] Export tab delimited from mysql to po=
stgres.





Quoth Theo.Galanakis@lonelyplanet.com.au (Theo Galanakis)=
:


>       =A0 Could you provide a example o=
f how to do this?


>

>       =A0 I actually ended up exporting=
the data as Insert statements,


> which strips out cf/lf within varchars. However it =
takes an eternity


> to import 200,000 records... 24 hours infact???? Is=
this normal?



I expect that this results from each INSERT being a separ=
ate transaction.



If you put a BEGIN at the start and a COMMIT at the end, =
you'd doubtless see an ENORMOUS improvement.



That's not even the _big_ improvement, either.  The =
_big_ improvement would involve reformatting the data so that you could use=
the COPY statement, which is _way_ faster than a bunch of INSERTs.  T=
ake a look at the documentation to see the formatting that is needed: >



opy.php" TARGET=3D"_blank">http://techdocs.postgresql.org/techdocs/us ingcop=
y.php


RGET=3D"_blank">http://www.faqs.org/docs/ppbook/x5504.htm

-copy.html" TARGET=3D"_blank">http://www.postgresql.org/docs/7.4/static/ sql=
-copy.html


--

output =3D ("cbbrowne" "@" "ntl=
ug.org") =3D"_blank">http://www3.sympatico.ca/cbbrowne/lsf.html


Question: How many surrealists does it take to change a =
light bulb?



Answer: Two, one to hold the giraffe, and the other to fi=
ll the bathtub


        with brightly=
colored machine tools.



---------------------------(end of broadcast)------------=
---------------


TIP 2: you can get off all lists at once with the unregi=
ster command


    (send "unregister YourEmailAddre=
ssHere" to majordomo@postgresql.org)





____________________=
__________________________________________________
This email, including=
attachments, is intended only for the addressee
and may be confidential=
, privileged and subject to copyright. If you
have received this email =
in error, please advise the sender and delete
it. If you are not the in=
tended recipient of this email, you must not
use, copy or disclose its c=
ontent to anyone. You must not copy or
communicate to others content t=
hat is confidential or subject to
copyright, unless you have the consen=
t of the content owner.
=

------_=_NextPart_001_01C4B01D.0B865670--

Re: Export tab delimited from mysql to postgres.

am 12.10.2004 09:20:21 von lists

A tested example in Python :
Basically it counts the \t and accumulates the lines until it has enough
and then prints the line.
Note : as an exercise you could add a test so that there are exactly
(columns-1) delimiters and not >=(columns-1).

def grouplines( in_stream, columns, delimiter ):
num_delimiters = columns - 1
accum = ''
for line in in_stream:
accum += line
if accum.count( delimiter ) >= num_delimiters:
print accum.replace( "\n", "\\n" )
accum = ''

if accum:
print "Last line unterminated."

grouplines( open( 'data.in' ), 3, "\t" ):


Input data (I added a column over your example):
1 What a day! A
2 What a week it has
been! B
3 What the! C

Output :
1 What a day! A\n
2 What a week it has\nbeen! B\n
3 What the! C

Have fun with your copy !

On Tue, 12 Oct 2004 15:33:46 +1000, Theo Galanakis
wrote:

>
> Thanks for all your comments,
>
> I have beent trying the insert within a transaction block, however
> it does not seem to reduce the time it takes to process each records.
> Mind
> you there are 80 column and the insert statement explicitly defines the
> column to insert into.
>
> I need any tip I can get help me transform the text file into a
> format postgres copy will successfully read.
>
>
> Here is sample of the current format of a mysql tab delimited dump..
>
> columnA columnB
>
> 1 What a day!
> 2 What a week it has
> been!
> 3 What the!
>
> As you can see row 2 has a value that holds a CR value which ends up
> wrapping around onto the third line. Postgres copy command does not like
> this and mysql is unable to replace the value with another type of
> delimiter, like a \r.
>
> So I gather I have to some how manually replace the carriage return with
> something postgres understand \r...
>
>
> columnA columnB
>
> 1 What a day!
> 2 What a week it has \r been!
> 3 What the!
>
> How do I do this without getting a text file that looks like this
>
> 1 What a day! \r\n2 What a week it has \r been!\r\n3
> What the!\r\n
>
> Any help would be appreciated.
>
> Theo
>
> -----Original Message-----
> From: Christopher Browne [mailto:cbbrowne@acm.org]
>
> Sent: Tuesday, 12 October 2004 10:46 AM
> To: pgsql-sql@postgresql.org
> Subject: Re: [SQL] Export tab delimited from mysql to postgres.
>
>
> Quoth Theo.Galanakis@lonelyplanet.com.au (Theo Galanakis):
>>         Could you provide a example of how to do this?
>>
>>         I actually ended up exporting the data as Insert statements,
>> which strips out cf/lf within varchars. However it takes an eternity
>
>> to import 200,000 records... 24 hours infact???? Is this normal?
>
> I expect that this results from each INSERT being a separate transaction.
>
> If you put a BEGIN at the start and a COMMIT at the end, you'd doubtless
> see
> an ENORMOUS improvement.
>
> That's not even the _big_ improvement, either. The _big_ improvement
> would
> involve reformatting the data so that you could use the COPY statement,
> which is _way_ faster than a bunch of INSERTs. Take a look at the
> documentation to see the formatting that is needed:
>
> http://techdocs.postgresql.org/techdocs/usingcopy.php
> http://www.faqs.org/docs/ppbook/x5504.htm
> http://www.postgresql.org/docs/7.4/static/sql-copy.html
> --
>
> output = ("cbbrowne" "@" "ntlug.org")
> http://www3.sympatico.ca/cbbrowne/lsf.html
> Question: How many surrealists does it take to change a light bulb?
>
> Answer: Two, one to hold the giraffe, and the other to fill the bathtub
> with brightly colored machine tools.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
>
> ____________________________________________________________ __________
> This email, including attachments, is intended only for the addressee
> and may be confidential, privileged and subject to copyright. If you
> have received this email in error, please advise the sender and delete
> it. If you are not the intended recipient of this email, you must not
> use, copy or disclose its content to anyone. You must not copy or
>
> communicate to others content that is confidential or subject to
>
> copyright, unless you have the consent of the content owner.



---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

Re: Export tab delimited from mysql to postgres.

am 12.10.2004 15:56:15 von tgl

Theo Galanakis writes:
> As you can see row 2 has a value that holds a CR value which ends up
> wrapping around onto the third line. Postgres copy command does not like
> this and mysql is unable to replace the value with another type of
> delimiter, like a \r.

> So I gather I have to some how manually replace the carriage return with
> something postgres understand \r...

> columnA columnB
> 1 What a day!
> 2 What a week it has \r been!
> 3 What the!

> How do I do this without getting a text file that looks like this
> 1 What a day! \r\n2 What a week it has \r been!\r\n3
> What the!\r\n

Looks like a simple sed problem to me:

cat myfile | sed 's/\r$//' | sed 's/\r/\\r/g' >newfile

(Most likely you can do both steps in one sed process, but this is easy
to follow.) This assumes that you only have newlines (\n) at the real
ends of lines, else you need to think harder about how to tell the
difference between data and formatting.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Re: Export tab delimited from mysql to postgres.

am 13.10.2004 01:56:01 von Theo.Galanakis

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C4B0B7.06B7F780
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Thankyou all for your advice,

Looking further into the issue I have realised that "data and formatting"
lines are denoted by the same CR/LF symbols. So if I where to replace all
CR/LF symbols it would create a file with one line... I have replace the
CR/LF for reading purposes below with \r\n or alternatively 0D 0A (hex):

columnA columnB=0D
1 What a day!\r\n
2 What a week it has\r\n
been!\r\n
3 What the!\r\n

What this means that it is impossible to move line three back to line two to
look something like this:

columnA columnB=0D
1 What a day!\r\n
2 What a week it has\rbeen!\r\n
3 What the!\r\n

I was thinking of writing code that checked each line to see if correct
number of tab delimited elements in this case 2 elements, if this was not
the case replace the \r\n with \r.

Theo


-----Original Message-----
From: Harald Fuchs [mailto:hf0722x@protecting.net]=0D
Sent: Wednesday, 13 October 2004 1:38 AM
To: Theo Galanakis
Subject: Re: Export tab delimited from mysql to postgres.


>       =A0 Could you provide a example of how to do this?

Depends on what exactly your dump file contains. Probably something like

sed 's/\\\r/\\r/g'

This means: replace all carriage returns preceded by a backslash by '\r'.


____________________________________________________________ __________
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright. If you
have received this email in error, please advise the sender and delete
it. If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone. You must not copy or=0D
communicate to others content that is confidential or subject to=0D
copyright, unless you have the consent of the content owner.=

------_=_NextPart_001_01C4B0B7.06B7F780
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable




1">

RE: Export tab delimited from mysql to postgres.



Thankyou all for your advice,



Looking further into the issue I have realised that "=
;data and formatting" lines are denoted by the same CR/LF symbols. So =
if I where to replace all CR/LF symbols it would create a file with one lin=
e... I have replace the CR/LF for reading purposes below with \r\n or alter=
natively 0D 0A (hex):



columnA          =
       columnB


1         &=
nbsp;     What a day!\r\n


2         &=
nbsp;     What a week it has\r\n


been!\r\n

3         &=
nbsp;     What the!\r\n



What this means that it is impossible to move line three =
back to line two to look something like this:



columnA          =
       columnB


1         &=
nbsp;     What a day!\r\n


2         &=
nbsp;     What a week it has\rbeen!\r\n


3         &=
nbsp;     What the!\r\n



I was thinking of writing code that checked each line to =
see if correct number of tab delimited elements in this case 2 elements, if=
this was not the case replace the \r\n with \r.



Theo





-----Original Message-----

From: Harald Fuchs [ ..net">mailto:hf0722x@protecting.net]

Sent: Wednesday, 13 October 2004 1:38 AM

To: Theo Galanakis

Subject: Re: Export tab delimited from mysql to postgres=
..





>       =A0 Could you provide a example of=
how to do this?



Depends on what exactly your dump file contains.  Pr=
obably something like



  sed 's/\\\r/\\r/g'



This means: replace all carriage returns preceded by a ba=
ckslash by '\r'.





____________________=
__________________________________________________
This email, including=
attachments, is intended only for the addressee
and may be confidential=
, privileged and subject to copyright. If you
have received this email =
in error, please advise the sender and delete
it. If you are not the in=
tended recipient of this email, you must not
use, copy or disclose its c=
ontent to anyone. You must not copy or
communicate to others content t=
hat is confidential or subject to
copyright, unless you have the consen=
t of the content owner.
=

------_=_NextPart_001_01C4B0B7.06B7F780--